package com.rrd.itext.xmlBean.layoutBean;

import java.util.ArrayList;
import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("Page")
public class XmlPage{
	@XStreamAsAttribute
	private String description;
	@XStreamAsAttribute
	private String name;
	@XStreamAsAttribute
	private String size;
	@XStreamAsAttribute
	private String margin;
    @XStreamAsAttribute
	private String type;
    @XStreamAsAttribute
    private Boolean displayPageNumber;
    @XStreamAsAttribute
    private String pageNumberPosition;
	
	@XStreamAlias("Zones")
	private List<XmlZone> zones;
	
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<XmlZone> getZones() {
		return zones==null?new ArrayList<XmlZone>():zones;
	}

	public void setZones(List<XmlZone> zones) {
		this.zones = zones;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public String getMargin() {
		return margin;
	}

	public void setMargin(String margin) {
		this.margin = margin;
	}

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getPageNumberPosition() {
        if(pageNumberPosition != null && ("right".equalsIgnoreCase(pageNumberPosition) || "left".equalsIgnoreCase(pageNumberPosition) || "middle".equalsIgnoreCase(pageNumberPosition))){
            return pageNumberPosition;
        }
        return "right";
    }

    public void setPageNumberPosition(String pageNumberPosition) {
        this.pageNumberPosition = pageNumberPosition;
    }

    public Boolean isDisplayPageNumber() {
        return displayPageNumber;
    }

    public void setDisplayPageNumber(Boolean displayPageNumber) {
        this.displayPageNumber = displayPageNumber;
    }

}